#include <iostream>
#include <algorithm>
using namespace std;

signed main()
{
    int n,a[100005];
    cin>>n;
    int sum1 = 0,sum2 = 0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum1 += a[i];
    }
    sort(a,a+n);
    for(int i=0;i<n/2;i++){
        sum1 -= a[i];
        sum2 += a[i];
    }
    cout<<(n%2==0?0:1)<<" "<<sum1-sum2;
    return 0;
}
